<?php

/**
 * home actions.
 *
 * @package    nutrition
 * @subpackage home
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class homeActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
    $this->news = Doctrine_Core::getTable('dynamicinfomation')->getNewsList(6);
    $this->schools = Doctrine::getTable('dynamicinfomation')->getSchoolsList(6);
    $this->intro = Doctrine::getTable('staticinfomation')->getIntroduction();
    $this->policies = staticinfomationTable::getInstance()->getPolicies(6);
  }
  
  public function executeAjaxNews(sfWebRequest $request)
  {
      $news = Doctrine_Core::getTable('dynamicinfomation')->getNewsList(6);
      return $this->renderPartial('ajax_lists', array('topics'=>$news, 'name'=>'news'));
  }
  public function executeAjaxSchools(sfWebRequest $request)
  {
      $schools = Doctrine_Core::getTable('dynamicinfomation')->getSchoolsList(6);
      return $this->renderPartial('ajax_lists', array('topics'=>$schools, 'name'=>'school'));
  }  

}
